Skip to content

feat: deprecate adapter-cloudflare-workers in favour of adapter-cloudflare#13634

Merged
teemingc merged 24 commits intomainfrom
merge-cloudflare-adapters
Apr 2, 2025
Merged

feat: deprecate adapter-cloudflare-workers in favour of adapter-cloudflare#13634
teemingc merged 24 commits intomainfrom
merge-cloudflare-adapters

Conversation

@teemingc
Copy link
Copy Markdown
Member

@teemingc teemingc commented Mar 24, 2025

an alternative that closes #13427

closes #13360
closes #13071
closes #13005
closes #12813
closes #13579
closes #10924

This PR adds a deprecation notice to the adapter-cloudflare-workers docs while adding support for Cloudflare Workers Static Assets by skipping Cloudflare Pages-specific build steps and respecting Wrangler configuration settings if building for Cloudflare Workers Static Assets.

We use a heuristic to guess whether we're building for Cloudflare Pages or Workers based on the Wrangler configuration file settings, but even if there is no Wrangler configuration file, the build output is compatible with both platforms.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 24, 2025

🦋 Changeset detected

Latest commit: 49d28e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-cloudflare Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@svelte-docs-bot
Copy link
Copy Markdown

@teemingc teemingc requested a review from benmccann March 24, 2025 10:42
@teemingc teemingc mentioned this pull request Mar 25, 2025
6 tasks
Copy link
Copy Markdown
Contributor

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! I love seeing a single adapter that chooses workers or pages for you based on the config file! 🫶

teemingc and others added 2 commits March 26, 2025 09:54
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
@teemingc
Copy link
Copy Markdown
Member Author

teemingc commented Mar 26, 2025

Thanks for the feedback guys. I've updated the docs and also bumped the minimum Wrangler version to v4. I've also updated the fallback option to work with Cloudflare Workers if the user has configured the assets 404-handling option.

EDIT: I've also added some simple tests to check that the build output is successful and works with the pages/workers dev environment provided by wrangler.

@teemingc teemingc merged commit ebec1e9 into main Apr 2, 2025
31 of 32 checks passed
@teemingc teemingc deleted the merge-cloudflare-adapters branch April 2, 2025 02:26
@github-actions github-actions bot mentioned this pull request Apr 2, 2025
Copilot AI pushed a commit to Stadly/kit that referenced this pull request Mar 6, 2026
…oudflare` (sveltejs#13634)

* merge adapters

* changeset

* it's valid to not specify a main entry if the user is only deploying static assets

* format

* adjust docs

* also use cf pages env var

* fix migration guide link

* try to fix doc build error

* Update index.d.ts

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>

* Update kind-carrots-deliver.md

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>

* validate assets key if main key is set

* delete adapter-cloudflare-workers

* adjust docs and workspace for removing cloudflare workers

* fix docs title

* clarify _routes.json belongs to cloudflare pages

* Update packages/adapter-cloudflare/src/worker.js

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>

* changes according to feedback

* revert type change

* fix lock file

* fixes

* tests

* fix lockfile

* format

---------

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants